; pointer about two lists.
(defun two-cons ()
  (let ((a '(1 2))
	(cons1 0)
	(cons2 0))
    (setf cons1 (cons a '(2 3)))
    (setf cons2 (cons a '(2 3)))
    (format t "compare :~A~%" (eql cons1 cons2))
    (setf (car (car cons1)) 2)
    (format t "a is ~A. ~%cons1 is ~A. ~%cons2 is ~A." a cons1 cons2)))

; pointer about two valriables
(defun two-value ()
  (let ((x '(1 2 3))
	(y '()))
    (setf y x)
    (format t "x is ~A.~%" x)
    (format t "setf y x.~%")
    (format t "y is ~A.~%" y)
    (format t "Are they eql? :~A.~%" (eql x y))
    (setf (car y) 2)
    (format t "setf (car y) 2.~%Now:~%")
    (format t "x is ~A.~%y is ~A.~%" x y)
    (format t "Are they eql? :~A.~%" (eql x y))))

; about copy-list
(defun test-copy-list ()
  (let ((a '(1 2))
	(b '(3 4))
	(lst '())
	(lst-cp '()))
    (setf lst (cons a b))
    (format t "lst    is ~A.~%" lst)
    (setf lst-cp (copy-list lst))
    (format t "setf lst-cp (copy-list lst).~%")
    (format t "lst-cp is ~A.~%" lst-cp)
    (format t "setf (car (car lst-cp)) 2.~%")
    (setf (car (car lst-cp)) 2)
    (format t "lst    is ~A.~%" lst)
    (format t "lst-cp is ~A.~%" lst-cp)
    (format t "setf (car lst-cp) 3.~%")
    (setf (car lst-cp) 3)
    (format t "lst    is ~A.~%" lst)
    (format t "lst-cp is ~A.~%" lst-cp)))

;; about valriable
(defun test-variable ()
  (let ((a (list '(1 3) 2))
	(b '()))
    (setf b a)
    (format t "eql? :~A~%" (eql a b))
    (setf (car (car b)) 3)
    (format t "a is ~A.~%" a)
    (format t "b is ~A.~%" b)))


;; about append
(defun test-append ()
  (let ((a '(1 2 3))
	(b 1)
	(c '(a b c))
	(d '(c)))
    (append a c d b)))
	
	  
